<template>
    <view class="send_box">
    <view class="custom" :style="'top:' + customTop + 'px'">
        <text>发布</text>
    </view>
    <view class="main">
        <view class="header" :style="'padding-top:' + titleHeight + 'px'"></view>
    </view>
    <view class="p_20 " style="position: relative;z-index:99">
        <view v-if="isUp==1" class="dis_f_c_c" style="font-size: 40rpx;margin-top: 200rpx">
            欢迎使用恩多信息
        </view>
        <view v-else>
            <view class="dis_f_sb_c gy p_20 p_b_20 c_f f_s_20 f_w_b " style="background: #82bfff;" @click="handleToInfo(1)">
                <view  class="dis_f_l_c">
                    <image :src="hireLogo[0].url" style="width: 100rpx;height: 100rpx;"></image>
                    <view class="m_l_10"> 我要招聘</view>
                </view>
                <u-icon name="arrow-right" color="#fff"></u-icon>
            </view>
            <view class="dis_f_sb_c gy p_20 p_b_20 c_f m_t_10 f_s_20 f_w_b"  @click="handleToInfo(2)">
                <view class="dis_f_l_c">
                    <image :src="hireLogo[1].url" style="width: 100rpx;height: 100rpx;"></image>
                    <view class="m_l_10"> 我要求职</view>
                </view>
                <u-icon name="arrow-right" color="#fff"></u-icon>
            </view>
        </view>
        <!-- 授权弹窗 -->
        <s-auth-modal />
    </view>
    </view>
</template>
<script>
import { getByKeyApi,getMyInfoApi} from "@/sheep/api/index";
export default {
    name: "index",
    data() {
        return {
            customTop: 0,
            titleHeight: 0,
            isUp:'',
            hireLogo:[],
            isRealnameSend:''
        }
    },
    onShow() {
        this.getIsUp()
        this.getHeight()
        this.getIsRealnameSend()
        this.getLogo()
    },
    methods: {

        // 获取微信右上角胶囊高度
        getHeight() {
            let res = uni.getMenuButtonBoundingClientRect();
            this.titleHeight = res.top + 10;
            this.customTop = res.top + 3;
        },
        handleToInfo(type){
            uni.navigateTo({
                url: '/pages/send/info?type='+type
            })
   /*         if (this.isRealnameSend==1){
                getMyInfoApi().then((res) => {
                    if(res.data.ifCardReview!=3){
                        //二级确认
                        uni.showModal({
                            title: "提示",
                            content: "实名认证通过后可发布信息",
                            confirmText: "去认证",
                            success: (res) => {
                                if (res.confirm) {
                                    uni.navigateTo({
                                        url: '/pages/mine/realName'
                                    })
                                }
                            }
                        })
                    }else{
                        uni.navigateTo({
                            url: '/pages/send/info?type='+type
                        })
                    }

                });
            }else{
                uni.navigateTo({
                    url: '/pages/send/info?type='+type
                })
            }*/
        },
        async getIsUp() {
            let res = await getByKeyApi("is_up");
            this.isUp = res.data[0].configValue;
        },
        async getLogo() {
            let res = await getByKeyApi("hire_logo");
            this.hireLogo = res.data;
        },
        async getIsRealnameSend() {
            let res = await getByKeyApi("isRealnameSend");
            this.isRealnameSend = res.data[0].configValue;
        },
    }
}
</script>

<style scoped lang="scss">
.gy{
    border-radius: 10rpx;
    background: #fdce8f;
}
.custom {
    position: absolute;
    left: 50%;
    transform: translate(-50%, 0);
    font-size: 40rpx;
    font-weight: bolder;
    display: flex;
    align-items: center;
    z-index: 1;
}
.main {
    padding: 0 10rpx;
    .header {
        display: flex;
        padding: 42rpx 0;
        color: #fff;
        justify-content: space-between;
        &::after {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            width: 100%;
            height: 100%;
            background: url("https://gsdq-1329143881.cos.ap-beijing.myqcloud.com/minebg.png")
            no-repeat;
            background-size: 100% auto;
        }
    }
}
</style>
